import { createStore, createLogger } from 'vuex'
import * as types from './mutation-types'
import createSearchStore from './modules/search'
const debug = process.env.NODE_ENV !== 'production'
export const store = createStore({
    state() {
        return {
            headerVisible: true
        }
    },
    mutations: {
        [types.SET_HEADER] (state, payload) {
            state.headerVisible = payload
        }
    },
    modules: {
        search: createSearchStore()
    },
    strict: debug,
    plugins: debug ? [createLogger()] : []
})